package com.CmJava.Dubbo.provider;


import com.CmJava.Dubbo.provider.httpServer.HttpServer;
import com.CmJava.Dubbo.provider.register.localRegister.LocalRegister;
import com.CmJava.Dubbo.provider.register.remoteRegister.RemoteRegister;
import com.CmJava.Dubbo.provider.register.remoteRegister.URL;
import com.CmJava.Dubbo.provider.sevice.DubboProviderService;
import com.CmJava.Dubbo.provider.sevice.DubboProviderServiceImpl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {

    public static void main(String[] args) {

        //服务实现类注册
        //本地注册
        LocalRegister.register(DubboProviderService.class.getName(),DubboProviderServiceImpl.class);
        //远程注册(模拟注册中心)
        RemoteRegister.register(DubboProviderService.class.getName(),new URL("http","localhost","8888","/DubboProviderService/get"));

        //启动tomcat
        HttpServer httpServer = new HttpServer();
        httpServer.start("8888","localhost");


    }
}
